Skip to content

fix(echarts): retain the clicked category when drilling on mixed charts - #46379

Merged
mikebridge merged 4 commits into
apache:masterfrom
mikebridge:fix-mixed-drill-by-category
Nov 20, 2026
Merged

mikebridge merged 4 commits into
apache:masterfrom
mikebridge:fix-mixed-drill-by-category

Conversation

@mikebridge

@mikebridge mikebridge commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

SUMMARY

Drill by on a Mixed Timeseries chart keeps the clicked category for the selected query, for datasets and semantic views.

Mixed charts passed series filters and temporal buckets to Drill by but omitted non-temporal categories. This adds the category to the existing scope and resolves markerless line/area clicks through the rendered category axis. The category must exist in the clicked series, preserving sparse-query behavior. Boolean categories retain their true/false values too. Temporal handling, cross-filter behavior and the other query's controls are unchanged.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: drilling from CORP on a markerless line could return other categories and omit CORP from the breadcrumb. After: the selected query receives the CORP predicate. Browser checks on revision 3fa9b120b8d804cc4b69c16a972238e6b2dc1a97 verified the breadcrumb, chart mode and selected query's table with only CORP and independently calculated F=30.25/O=7.75. No layout change.

TESTING INSTRUCTIONS

  • Six focused Jest suites: 125 tests passed; changed-file pre-commit including TypeScript passed. The four Boolean point/markerless tests failed before the guard correction. The eight existing integration tests exercise real Mixed handler, ECharts coordinate model, submenu, modal and query builder for both source types and queries.
  • The initially failing browser run was followed by a corrected acceptance helper: it identifies and isolates query B via its visible legend, requires a current CORP tooltip, waits for menu animations, selects Table and Results 2, and checks the pivoted grid against independent control values. Two consecutive runs each passed all six cases (ordinary and semantic sources, three repetitions each, no retries) at the revision above. This resolves the earlier missing-submenu scenario in those repeated runs; series selection and animation waits changed together, so their individual effects were not isolated.
  • Browser coverage is specifically query B's markerless line, not a separate query-A click, general keyboard accessibility, or this later Boolean follow-up. No fresh browser run is claimed for the master merge or Boolean change.
  • Create a Mixed chart with a categorical x-axis, query A as bars and B as a markerless line. Right-click a category and drill by another dimension; verify the breadcrumb and selected query's filter. Repeat with false/true categories and with A/B swapped. The unclicked query remains independent.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
  • Introduces new feature or API
  • Removes existing feature or API

@github-actions github-actions Bot added doc Namespace | Anything related to documentation plugins labels Nov 19, 2026
@mikebridge
mikebridge marked this pull request as ready for review November 19, 2026 19:04
@mikebridge
mikebridge marked this pull request as draft November 19, 2026 19:09
Comment on lines +277 to +281
if (
categoryValue === null ||
typeof categoryValue === 'string' ||
typeof categoryValue === 'number'
) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Boolean values are valid categorical x-axis values, but this guard rejects them, so drilling from a Boolean category omits its filter.

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Type error

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/EchartsMixedTimeseries.tsx
**Line:** 277:281
**Comment:**
	*Type Error: Boolean values are valid categorical x-axis values, but this guard rejects them, so drilling from a Boolean category omits its filter.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed at 578053e: a Boolean x-axis is a category axis (getAxisType), and data[0] or the matched point stays true/false, so this guard drops it and Drill by runs without the clicked category. Plain Timeseries keeps it through the name fallback.

Suggested change
if (
categoryValue === null ||
typeof categoryValue === 'string' ||
typeof categoryValue === 'number'
) {
if (
categoryValue === null ||
typeof categoryValue === 'string' ||
typeof categoryValue === 'number' ||
typeof categoryValue === 'boolean'
) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ CodeAnt verified this suggestion was addressed in subsequent commits and marked this thread resolved as of 7e64640.

The category-value guard now accepts booleans, so Boolean x-axis values are added to xAxisFilters.

If that's not right, unresolve this thread and CodeAnt will leave it open.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added boolean to the guard in 7e64640. Four red-first cases cover true and false on point and markerless clicks; all six focused suites pass.

@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; the Boolean category filter is handled, and focused tests cover point and markerless clicks.
  • Markerless category lookup preserves sparse-series behavior, and the existing sentinel remains compatible with backend null filtering.

Assessed commit: 7e646409bca5

@mikebridge
mikebridge marked this pull request as ready for review November 19, 2026 20:48
@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Nov 19, 2026
@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Nov 20, 2026
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.67%. Comparing base (f357ec3) to head (7e64640).
⚠️ Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
...rts/src/MixedTimeseries/EchartsMixedTimeseries.tsx 93.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #46379   +/-   ##
=======================================
  Coverage   85.66%   85.67%           
=======================================
  Files        3111     3111           
  Lines      214938   214948   +10     
  Branches    50908    50920   +12     
=======================================
+ Hits       184136   184147   +11     
+ Misses      27381    27380    -1     
  Partials     3421     3421           
Flag Coverage Δ
javascript 82.35% <93.33%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gabotorresruiz gabotorresruiz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mikebridge, thanks for this fix, LGTM. I ran the new tests on the merge base and on this head, and clicked through sparse, numeric, <NULL> and separator-heavy categories: the category filter lands only on the clicked query, and temporal axes send the same payload as before.

+1 to @aminghadersohi's boolean suggestion, with it both point and markerless clicks keep true/false.

One ask before this merges: the description still reads as a draft with the browser run failing. Could you update it with where that landed, in particular the case that could not open the submenu?

CI is green.

if (filter?.grain) {
xAxisFilters.push(filter);
}
} else if (xAxis.type === AxisType.Category && xAxisColumn) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker. Plain Timeseries still resolves a category click with getXAxisValue(data, eventParams.name), so a markerless line or area click there sends no category filter, the same gap this fixes for Mixed. Is a follow-up planned for it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That plain Timeseries path is unchanged here. I'd like to take its markerless-category handling as a separate follow-up so this patch stays focused on Mixed.

@mikebridge

Copy link
Copy Markdown
Member Author

@gabotorresruiz I've updated the description. The later browser runs passed for both source types, three repetitions each, in two consecutive runs with no retries. They isolate query B and wait for the menu before checking its pivoted results, which covers the earlier case that could not open the submenu. Series isolation and the animation waits changed together, so I can't say which one fixed it. Those runs do not cover the Boolean change in 7e64640 or general keyboard interaction.

@mikebridge
mikebridge merged commit 0c68380 into apache:master Nov 20, 2026
82 checks passed
hainenber pushed a commit that referenced this pull request Nov 21, 2026
…ts (#46379)

Co-authored-by: Mike Bridge <michael.bridge@ext.preset.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Namespace | Anything related to documentation plugins review:draft size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants